import { ajaxService } from '@/utils/request';

const env = import.meta.env;
// let baseURL = env.VITE_API_BASE_URL;
let baseURL = env.VITE_INVENTORY_URL;
let setURL = env.VITE_WECHAT_URL;

// 获取收货列表
export function GetWarehouseEntryAll(params?: any) {
  return ajaxService({
    url: '/warehouse/entry/getAll',
    method: 'get',
    baseURL,
    params,
  });
}

// 新增
export function postWarehouseEntry(data?: any) {
  return ajaxService({
    url: '/warehouse/entry/add',
    method: 'post',
    baseURL,
    data,
  });
}

// 获取单个
export function getWarehouseEntrySingle(params?: any) {
  return ajaxService({
    url: '/warehouse/entry/get',
    method: 'get',
    baseURL,
    params,
  });
}

// 修改状态
export function putWarehouseEntryState(data?: any) {
  return ajaxService({
    url: '/warehouse/entry/put',
    method: 'put',
    baseURL,
    data,
  });
}

// 删除
export function delWarehouseEntry(params?: any) {
  return ajaxService({
    url: '/warehouse/entry/delete',
    method: 'delete',
    baseURL,
    params,
  });
}

// 获取表头
export function GetHeaderAll(params?: any) {
  return ajaxService({
    url: '/warehouse/entry/header/get',
    method: 'get',
    baseURL,
    params,
  });
}

// 修改表头
export function putHeader(data?: any) {
  return ajaxService({
    url: '/warehouse/entry/header/edit',
    method: 'put',
    baseURL,
    data,
  });
}

// 获取入库列表
export function getStorageAll(params?: any) {
  return ajaxService({
    url: '/warehouse/storage/getAll',
    method: 'get',
    baseURL,
    params,
  });
}

// 获取入库列表
export function postNumSet(data?: any) {
  return ajaxService({
    url: '/warehouse/numset/add',
    method: 'post',
    baseURL,
    data,
  });
}

// 质检
export function putInspection(data?: any) {
  return ajaxService({
    url: '/wechat/warehouse/entry/inspection/state',
    method: 'put',
    baseURL: setURL,
    data,
  });
}

// 质检列表（小程序收货列表）
export function getInspectionAll(params?: any) {
  return ajaxService({
    url: '/wechat/warehouse/entry/getAll',
    method: 'get',
    baseURL: setURL,
    params,
  });
}
